package sg.edu.nus.iss.team4.entity;

import java.util.List;

public class Question {
	private Integer id;
	private String questionText;
	private boolean active;
	private String type;
	private String answerType;
	
	private List<Answer> answers;
	
	public Question() {}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getQuestionText() {
		return questionText;
	}

	public void setQuestionText(String questionText) {
		this.questionText = questionText;
	}

	public boolean getActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getAnswerType() {
		return answerType;
	}

	public void setAnswerType(String answerType) {
		this.answerType = answerType;
	}

	public List<Answer> getAnswers() {
		return answers;
	}

	public void setAnswers(List<Answer> answers) {
		this.answers = answers;
	}
	
	public void addAnswer(Answer answer) {
		if (!answers.contains(answer)) {
			answers.add(answer);
		}
	}
	
	public String toString() {
		return "ID = " + id + ", Question = " + questionText + ", Active = " + active + ", Type = " + type + ", Answer Type = " + answerType + ", Answers = " + answers;
	}
}